<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {font-size: 20px}
        .odd {color:red}
    </style>
    <script th:inline="javascript">
        let msg = [[${msg}]];
        //alert(msg);
    </script>
</head>
<body>
    <!--<iframe src="inc.html"></iframe>-->
    <div th:include="inc.html"></div>

    <table>
        <tr>
            <th>编号</th>
            <th>用户名</th>
            <th>密码</th>
            <th>奇偶</th>
        </tr>
        <th:block th:each="user:${list}">
            <tr th:if="${userStat.odd}" th:class="odd">
                <td th:text="${user.id}">编号1</td>
                <td th:text="${user.username}">用户名1</td>
                <td th:text="${user.password}">密码1</td>
                <td th:if="${userStat.odd}" th:text="偶数">奇偶</td>
                <td th:unless="${userStat.odd}" th:text="奇数">奇偶</td>
            </tr>
            <tr th:unless="${userStat.odd}">
                <td th:text="${user.id}">编号1</td>
                <td th:text="${user.username}">用户名1</td>
                <td th:text="${user.password}">密码1</td>
                <td th:if="${userStat.odd}" th:text="偶数">奇偶</td>
                <td th:unless="${userStat.odd}" th:text="奇数">奇偶</td>
            </tr>
        </th:block>
    </table>

    <select th:field="*{user.id}">
        <option value="0">请选择</option>
        <option th:each="user:${list}"
                th:value="${user.id}" th:text="${user.username}">用户</option>
    </select>

    <form th:object="${user}">
        编号：<input th:value="*{id}"/>
        用户名：<input th:value="*{username}"/>
    </form>

    日期：<span th:text="${#dates.format(now,'yyyy年MM月dd日')}">日期</span>
    数字：<span th:text="${#numbers.formatDecimal(nums,1,2)}">数字</span>
    <div th:text="${#strings.substring(msg,0,5)}">截取</div>
    <div th:text="${#lists.size(list)}">list size</div>

    <a href="page?pageIndex=1" th:href="@{'page/'+${url}(pageIndex=${pageIndex},pageSize=${pageSize})}">分页1</a>
    <a href="page?pageIndex=1" th:href="@{|page/${url}?pageIndex=${pageIndex}&pageSize=${pageSize}|}">分页1</a>
    <a href="page/1/2" th:href="@{'page/'+${url}+'/'+${pageIndex}+'/'+${pageSize}}">分页2</a>
    <a href="page/1/2" th:href="@{|page/${url}/${pageIndex}/${pageSize}|}">分页2</a>
</body>
</html>